Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
Loading...
Searching...
No Matches
time.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2015 Roc authors
3 *
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 */
8
9//! @file roc_core/time.h
10//! @brief Time definitions.
11
12#ifndef ROC_CORE_TIME_H_
13#define ROC_CORE_TIME_H_
14
15#include "roc_core/stddefs.h"
16
17namespace roc {
18namespace core {
19
20//! Nanoseconds.
21typedef int64_t nanoseconds_t;
22
23//! One nanosecond represented in nanoseconds.
25
26//! One microsecond represented in nanoseconds.
28
29//! One millisecond represented in nanoseconds.
31
32//! One second represented in nanoseconds.
34
35//! One minute represented in nanoseconds.
37
38//! One hour represented in nanoseconds.
40
41//! Get current timestamp in nanoseconds.
43
44//! Sleep until the specified absolute time point has been reached.
45//! @remarks
46//! @p timestamp specifies absolute time point in nanoseconds.
48
49//! Sleep specified amount of time.
50//! @remarks
51//! @p duration specifies number of nanoseconds to sleep.
52void sleep_for(nanoseconds_t duration);
53
54} // namespace core
55} // namespace roc
56
57#endif // ROC_CORE_TIME_H_
const nanoseconds_t Millisecond
One millisecond represented in nanoseconds.
Definition: time.h:30
void sleep_for(nanoseconds_t duration)
Sleep specified amount of time.
const nanoseconds_t Nanosecond
One nanosecond represented in nanoseconds.
Definition: time.h:24
nanoseconds_t timestamp()
Get current timestamp in nanoseconds.
void sleep_until(nanoseconds_t timestamp)
Sleep until the specified absolute time point has been reached.
const nanoseconds_t Second
One second represented in nanoseconds.
Definition: time.h:33
const nanoseconds_t Minute
One minute represented in nanoseconds.
Definition: time.h:36
const nanoseconds_t Microsecond
One microsecond represented in nanoseconds.
Definition: time.h:27
const nanoseconds_t Hour
One hour represented in nanoseconds.
Definition: time.h:39
int64_t nanoseconds_t
Nanoseconds.
Definition: time.h:21
Root namespace.
Commonly used types and functions.